import request from "../utils/request.js"

/**
 * 查询会话 根据 ID
 * @param sessionId
 * @returns {*}
 */
export function findChatSessionById(sessionId) {
    return request({
        url: `/session/${sessionId}`,
        method: 'get',
    });
}

/**
 * 查询所有会话
 * @param params
 * @returns {*}
 */
export function queryChatSession(params) {
    return request({
        url: '/session/query',
        method: 'get',
        params: params
    });
}

/**
 * 新增或修改会话
 * @param chatSession
 * @returns {*}
 */
export function saveOrUpdateChatSession(chatSession) {
    return request({
        url: '/session',
        method: 'post',
        data: chatSession
    });
}

/**
 * 删除会话
 * @param sessionId
 * @returns {*}
 */
export function deleteChatSession(sessionId) {
    return request({
        url: `session/${sessionId}`,
        method: 'delete',
    });
}
